#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QDebug>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void initSerialPort();
    uchar Checksum(uchar * arr,int len);
    void refreshSerial();
    QStringList getSerialPortNames();
    QSerialPort *serial1;
    QTimer *timer;
private slots:
    void on_Connect_clicked();

    void on_SetPulse_clicked();

    void on_GoSteps_clicked();

    void on_Go_clicked();

    void timerSlot();

public:
    bool ConnectFlag = false;
    bool timerRun = false;
    uchar Trans[32];
private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
